/*
 * @Author: whq
 * @Date: 2025-08-05 21:30:15
 * @LastEditTime: 2025-08-05 21:59:38
 * @LastEditors: whq
 * @Description: 
 * @FilePath: \app\src\store\modules\cards.ts
 */
// stores/cards.js
import { defineStore } from "pinia";
import { ref } from "vue";
import { RoleCard } from "@/types/cards";
export const useCardsStore = defineStore("cards", () => {
  // 1. 当前选中的卡片详情数据
  const currentCard = ref<RoleCard>();

  // 2. 设置卡片详情数据
  const setCurrentCard = (cardData: RoleCard) => {
    currentCard.value = cardData;
  };

  // 3. 清除卡片数据（可选）
  const clearCurrentCard = () => {
    currentCard.value = undefined;
  };

  return {
    currentCard,
    setCurrentCard,
    clearCurrentCard,
  };
}, {
  persist: true // 持久化当前卡片数据
});
